﻿<Window x:Class="WPFVDRUtility.VDRUtil"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Crystal Consulting Terminal" Height="700" Width="913" Loaded="Window_Loaded" Closed="Window_Closed" SizeToContent="Manual" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" AllowsTransparency="False">    
    <Grid>
        <DockPanel Background="LightGoldenrodYellow" Margin="0,0,0,0">
            <StackPanel DockPanel.Dock="Top">
                <ToolBarTray>
                    <ToolBar Band="0">
                    <Menu>
                        <MenuItem Header="_File">
                            <MenuItem Header="Exit" Click="OnExit" />
                        </MenuItem>
                            <MenuItem Header="_Edit">
                                <MenuItem Command="ApplicationCommands.Copy"/>
                                <MenuItem Command="ApplicationCommands.Cut"/>
                                <MenuItem Command="ApplicationCommands.Paste"/>
                                <MenuItem x:Name="EditFormat" Header="Format"/>
                            </MenuItem>
                            <MenuItem Header="_Help">
                            <MenuItem Header="About" Click="OnAbout" />
                        </MenuItem>
                    </Menu>
                    </ToolBar>
                    <ToolBar Band="0">
                        <RadioButton Name="PickTerminal" IsChecked="True">
                            <AccessText>Terminal</AccessText>
                        </RadioButton>
                        <Separator/>
                        <RadioButton Name="PickVDRConfig">
                            <AccessText>Configuration</AccessText>
                        </RadioButton>
                    </ToolBar>
                </ToolBarTray>
            </StackPanel>
            <StackPanel Width="88">
                <TextBox Margin="0,5,0,0">Theme:</TextBox>
                <TextBox Margin="0,5,0,0" Name="ResourceTextBox" Text="{Binding ElementName=ResourceListBox,Path=SelectedItem}" IsReadOnly="True" TextChanged="ResourceTextBox_TextChanged" />
                <ListBox Margin="0,5,0,0" Height="200" Name="ResourceListBox" SelectedIndex="0"/>             
            </StackPanel>
            <StackPanel Width="650" Opacity="1" Background="LightBlue" DockPanel.Dock="Left">
                <TextBox FontWeight="Bold" Margin="3,3,3,3" IsReadOnly="True">Please select RS232 COM Port:</TextBox>
                <ComboBox Height="23" x:Name="comboBoxCom" DockPanel.Dock="Top" Margin="30,3,3,3" ToolTip="RS232 COM Port selection" SelectedIndex="0">
                    <ComboBoxItem>RadioShack USB to Serial (COM7)</ComboBoxItem>
                </ComboBox>
                <TabControl Height="550">
                    <TabItem Header="_Terminal">
                        <DockPanel>
                            <WrapPanel DockPanel.Dock="Top" FlowDirection="RightToLeft">
                                <Button Width="100" Click="Button_Click">Show/Hide Hex</Button>
                                <Button Height="23" Name="ButtonClear" Width="100">Clear Screen</Button>
                            </WrapPanel>
                            <TextBox x:Name="TextBoxterminal" DockPanel.Dock="Left" TextWrapping="NoWrap" AcceptsReturn="True" FontSize="14" FontWeight="Bold" BorderThickness="2" Width="315" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Visible" Foreground="Red" KeyUp="TextBoxterminal_KeyUp" TextChanged="TextBoxterminal_TextChanged">
                            </TextBox>
                            <TextBox x:Name="TextBoxTerminalHex" DockPanel.Dock="Left" TextWrapping="NoWrap" AcceptsReturn="True" FontSize="14" FontWeight="Bold" BorderThickness="2" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Auto" Width="325">
                            </TextBox>
                        </DockPanel>
                    </TabItem>
                </TabControl>
                <StatusBar x:Name="statusBar">
                    <StatusBarItem x:Name="StatusField">Status</StatusBarItem>
                    <StatusBarItem x:Name="StatusMessage"></StatusBarItem>
                    <StatusBarItem x:Name="StatusProgress"></StatusBarItem>
                </StatusBar>
            </StackPanel>
            <StackPanel DockPanel.Dock="Left" Height="630" Width="150">
                <Expander FontWeight="Bold" Header="Baud:" Height="100" IsExpanded="True">
                    <Grid>
                        <TextBox TextWrapping="WrapWithOverflow">Transformation speed between source and target</TextBox>
                    </Grid>
                </Expander>
                <TextBox Margin="3,3,3,3" IsReadOnly="True" FontWeight="Bold">Baud:</TextBox>
                <ComboBox x:Name="ComBoBaud" Margin="30,3,3,3">
                    <ComboBoxItem >9600</ComboBoxItem>
                    <ComboBoxItem IsSelected="True">115200</ComboBoxItem>
                </ComboBox>
                <TextBox Margin="3,3,3,3" IsReadOnly="True" FontWeight="Bold">Flow Control:</TextBox>
                <ComboBox x:Name="ComBoFlow" Margin="30,3,3,3">
                    <ComboBoxItem IsSelected="True">None</ComboBoxItem>
                    <ComboBoxItem>Hardware</ComboBoxItem>
                    <ComboBoxItem>Xon/Xoff</ComboBoxItem>
                </ComboBox>
                <TextBox Margin="3,3,3,3" FontWeight="Bold">Data Bits:</TextBox>
                <ComboBox x:Name="ComBoBits" Margin="30,3,3,3" IsReadOnly="True">
                    <ComboBoxItem>6</ComboBoxItem>
                    <ComboBoxItem>7</ComboBoxItem>
                    <ComboBoxItem IsSelected="True">8</ComboBoxItem>
                </ComboBox>
                <TextBox Margin="3,3,3,3" IsReadOnly="True" FontWeight="Bold">Parity:</TextBox>
                <ComboBox x:Name="ComBoParity" Margin="30,3,3,3">
                    <ComboBoxItem IsSelected="True">None</ComboBoxItem>
                    <ComboBoxItem>Odd</ComboBoxItem>
                    <ComboBoxItem>Even</ComboBoxItem>
                </ComboBox>
                <TextBox Margin="3,3,3,3" IsReadOnly="True" FontWeight="Bold">Stop Bit:</TextBox>
                <ComboBox x:Name="ComBoStopBit" Margin="30,3,3,3">
                    <ComboBoxItem>1</ComboBoxItem>
                    <ComboBoxItem>1.5</ComboBoxItem>
                    <ComboBoxItem IsSelected="True">2</ComboBoxItem>
                </ComboBox>
                <StackPanel Height="220">
                    <Button Margin="3,30,3,3" x:Name="OpenComPort" Width="100" Click="OpenComPort_Click" Height="25">Open COM Port</Button>
                    <Button Margin="3,3,3,3" x:Name="CloseComPort" Width="100" Click="CloseComPort_Click" Height="28.75">Close COM Port</Button>
                    <Button Margin="3,3,3,3" Width="100" Height="23" x:Name="buttonExit" Click="buttonExit_Click">Exit</Button>
                </StackPanel>    
            </StackPanel>
        </DockPanel>
    </Grid>
</Window>
